package com.resou.reader.data.signin;

import com.resou.reader.api.entry.Result;
import com.resou.reader.api.entry.ResultList;
import com.resou.reader.data.signin.model.BindingTask;
import com.resou.reader.data.signin.model.SignIn;
import com.resou.reader.data.signin.model.SignInInfo;
import com.resou.reader.data.signin.model.SignInInfo2;
import com.resou.reader.data.signin.model.SignStatus;

import io.reactivex.Observable;
import retrofit2.http.GET;
import retrofit2.http.Header;
import retrofit2.http.POST;
import retrofit2.http.Query;

/**
 * 签到接口
 */
public interface SignInService {

    /**
     * 签到
     *
     * @param token   用户的token
     * @param weekDay 补签时的每星期第几天
     * @return
     */
    @POST("welfare/dailySignIn")
    Observable<Result<SignIn>> signIn(@Header("token") String token, @Query("weekDay") int weekDay);

    /**
     * 检测当天是否已签到
     *
     * @param token
     * @return
     */
    @POST("welfare/userDailySignInfo")
    Observable<Result<SignStatus>> checkIsSignedIn(@Header("token") String token);

    /**
     * 获取签到规则（老版）
     *
     * @param token
     * @return
     */
    @POST("welfare/signInInfo")
    Observable<Result<SignInInfo>> getSignInInfo(@Header("token") String token);

    /**
     * 获取签到信息
     *
     * @param token
     * @return
     */
    @POST("welfare/signInInfo")
    Observable<Result<SignInInfo2>> getSignInInfo2(@Header("token") String token);

    //  http://47.105.43.74:8088/mobileserver/vip/updateVipTask?tvInputFrameCF8A4F8CAAFC55922F9075192326D06C&taskType=1&taskStatus=2

    /**
     * 获取绑定任务
     */
    @GET("vip/getVipTask")
    Observable<ResultList<BindingTask>> getVipTask(@Query("token") String token);

    /**
     * 领取签到任务奖励
     * @param token
     * @param taskId
     * @return
     */
    @POST("welfare/receiveWelfare")
    Observable<Result> receiveWelfare(@Header("token") String token, @Query("taskId") String taskId);
}
